// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.characters.action;

import java.util.HashMap;
import org.w3c.dom.Element;

public interface IActionCondition {
    HashMap<String, IActionCondition.IFactory> s_factoryMap = new HashMap();

    String getDescription();

    boolean passes(ActionContext context, int layerIdx);

    IActionCondition clone();

    static IActionCondition createInstance(Element conditionNode) {
        IActionCondition.IFactory iFactory = (IActionCondition.IFactory)s_factoryMap.get(conditionNode.getNodeName());
        return iFactory != null ? iFactory.create(conditionNode) : null;
    }

    static void registerFactory(String elementName, IActionCondition.IFactory factory) {
        s_factoryMap.put(elementName, factory);
    }

    public interface IFactory {
        IActionCondition create(Element conditionNode);
    }
}
